Fix: Prevent Tiled Gallery crash and add changelog entry (#49606)#50025
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Hi @nerrad, I've also submitted this PR to fix an editor crash that happens when users try to transform a standard Gallery block back into a Tiled Gallery (#49606). The crash happens because the block transformation expects the images data at the top-level attributes, but after a round-trip conversion, that data is only available inside When you have a moment, could you please take a look at this one as well and approve the CI workflows if they need maintainer clearance? If any changes or further adjustments are needed for this block component, just let me know here and I'll push them right away. Thanks! |
|
Hi @davemac, just following up here since it's been a few days — this PR fixes the original round-trip crash you reported. CI workflows are still awaiting maintainer approval. Whenever you get a chance, could you approve the workflows or loop in someone who can review? Happy to make any changes if needed. Thanks! |
|
Hi @Tejas-Raj01 I'm just the reporter on this one, not a Jetpack maintainer, so I'm afraid I can't approve CI workflows or assign reviewers. That'll need to come from the Automattic side; the What I can offer: I've been running the identical fix logic (default |
|
Nice fix, and recovering the images from the v2 gallery One thing I noticed while reading through it: when we rebuild the images, we're reading It's not a regression, since before this fix the whole thing crashed, so this is strictly better either way. But it's a one-word change, so it might be worth switching to Small nit while I'm here: this What do you think? |
|
Hi @jeherve, Thank you for the review and the kind words! Great catch on the href attribute. I completely missed that the core/image block stores the destination there instead of link. I have updated the extraction logic to use attributes.href so the links are successfully recovered during the transform. Regarding the shared helper for the innerBlocks extraction—I agree that would be much cleaner since the Slideshow block uses the exact same approach. I can create a follow-up PR to extract this into a shared utility function once these initial fixes land, or I can update both PRs now if you'd prefer. Just let me know! I've pushed the fix to this branch. Thanks again! |
Fixes #49606
Proposed changes
imagesattribute is recovered frominnerBlockswhen the top-level images attribute is empty or undefined.Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions
innerBlocks.